<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>买菜网</title>
    <link rel="stylesheet" type="text/css" href="/css/denglu.css" />
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="../js/jquery-3.3.1.min.js"></script>
    <script src="../js/jquery-form.js"></script>
    <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div>
    <div class="head1">
        <a href="/"><img class="xnkjdx" src="/image/LOGO.png"></a>
        <div class="new1">
            <button class="btn btn-link" data-toggle="modal" data-target="#myModal">帮助</button>
            <!-- 模态框（Modal） -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="myModalLabel">帮助框</h4>
                        </div>
                        <div class="modal-body">请输入您的账号密码，如果有问题请联系系统管理人员。</div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal -->
            </div>
        </div>
    </div>

    <div>
        <div class="chuangk">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion"
                           href="#collapseOne">
                            买菜网
                        </a>
                    </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <form name="login" action="login" method="post">
                            <div class="input-group input-group-lg">
                                <span class="input-group-addon"><img src="/image/user.png"></span>
                                <input type="text" class="form-control" id="username" placeholder="用户名">
                            </div>
                            <br>
                            <div class="input-group input-group-lg">
                                <span class="input-group-addon"><img src="/image/lock.jpg"></span>
                                <input class="form-control" type="password" id="password" placeholder="密码">
                            </div>
                            <br>
                            <input class="btn btn-default btn-lg btn-block" type="button" value="登陆" id="login" onclick="doSubmit()">
                            <br>
                            <a href="/html/zhuce.html"><input class="btn btn-default btn-lg btn-block" type="button" value="注册"></a>
                        </form>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <div class="foot">
        <p class="zhizuo"><a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=962717593" target="class">制作人信息：邱胜超</a></p>
    </div>
</div>
<script>
    function doSubmit() {
        $.post("/login", {
                "username":$("#username").val(),
                "password":$("#password").val()
            }, function(res) {
                if(res == 1){
                    $(location).attr('href', '/');
                }
                else{
                    alert("账号密码错误，请重新输入")
                    window.location.reload()
                }
        })
    }
</script>
</body>
</html>